package org.iabako.shared.iservice.function;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import org.iabako.shared.entity.business.Sale;
import org.iabako.shared.entity.business.SaleProductService;
import org.iabako.shared.entity.user.Enterprise;
import org.iabako.shared.entity.user.EnterpriseCustomInfo;
import org.iabako.shared.exception.IabakoActionForbiddenException;
import org.iabako.shared.exception.IabakoUniqueConstraintException;

import java.io.IOException;
import java.util.List;

/**
 * Created by jose on 05/02/15.
 */

@RemoteServiceRelativePath("iabakoServices/invoiceGeneratorService")
public interface InvoiceGeneratorService extends RemoteService {

    String generateSampleInvoice(Enterprise transientEnterprise, List<EnterpriseCustomInfo> transientCustomInfoList);

    String generateInvoiceForQuote(Sale saleFromGWT, List<SaleProductService> productServiceList) throws IabakoUniqueConstraintException, IabakoActionForbiddenException;

    String generateInvoice(Sale sale, Long idPayment, String invoiceNumber);

    void sendInvoiceByEmail(Sale entity, Long idPayment, String invoiceNumber, String email, String subject, String body) throws IOException;

    void sendQuoteByEmail(Sale saleFromGWT, List<SaleProductService> productServiceList, String email, String subject, String body) throws IOException, IabakoUniqueConstraintException, IabakoActionForbiddenException;
}
